﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using AutoMapper;

using DevWeb.Biztalk.DeploymentSettings.WebUI.Models;

namespace DevWeb.Biztalk.DeploymentSettings.WebUI.Automapper
{
    public class DefaultSettingsViewProfile : Profile
    {
        public const string ViewModel = "DefaultSettingsViewProfile";

        public override string ProfileName
        {
            get { return ViewModel; }
        }

        protected override void Configure()
        {
            CreateMaps();
        }

        private static void CreateMaps()
        {
            Mapper.CreateMap<Data.CodeFirst.DefaultSettingParameter, DefaultSettingsViewModel>()
                .ForSourceMember(s => s.DefaultSettingParameterValues, t => t.Ignore());



            Mapper.CreateMap<DefaultSettingsViewModel, Data.CodeFirst.DefaultSettingParameter>();

            Mapper.CreateMap<List<DefaultSettingsViewModel>, List<Data.CodeFirst.DefaultSettingParameter>>();
           // Mapper.CreateMap<List<Data.CodeFirst.DefaultSettingParameter>, List<DefaultSettingsViewModel>>();
                
            
        }
    }
}